home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name pcinvint -- Invoke a software interrupt service routine
- *
- * Synopsis ercode = pcinvint(intype,preg);
- * int ercode Return error code
- * int intype Interrupt type
- * struct dreg *preg Pointer to register structure
- *
- * Description This function invokes the interrupt service routine
- * associated with the interrupt type intype. Information
- * may be passed to the service routine via values in the
- * register structure, and the service routine may alter
- * this values for return. Because interrupt type 70 (hex)
- * is used by the Macro Assembler function to invoke the
- * specified interrupt, it cannot be defined as a user interrupt.
- * This function should not be used to access the BIOS or DOS
- * functions because error checking and register setting
- * are not performed. For example, the stack segment and pointer
- * are not saved. It is intended to invoke user defined software
- * interrupt service routines. Use the TOOLS function BIOS and
- * the TOOLS 2 function DOS to access the BIOS and DOS functions.
- *
- * Returns ercode The returned error code. If the interrupt
- * type is 70 1 is returned; otherwise 0.
- * preg The values of the registers may be altered
- * by the service routine associated with the
- * interrupt type.
- *
- * Version 1.1 (C)Copyright Blaise Computing Inc. 1983, 1984
- *
- **/
- struct dreg
- {
- unsigned ax,bx,cx,dx,si,di,ds,es;
- };
- #define DOSREG struct dreg
-
- struct segads /* Offset, segment address type */
- {
- unsigned r;
- unsigned s;
- };
- #define ADS struct segads /* Abbreviation */
-
- int pcinvint(intype,preg)
- int intype;
- DOSREG *preg;
- {
-
- ADS int_vector;
- int pcretvec(),pcsetvec(),invint();
-
- if (intype == 0x70)
- return(1); /* 70 is used by C TOOLS 2 */
-
- pcretvec(intype,&int_vector); /* Get the address of ISR */
- pcsetvec(0x70,&int_vector); /* Set interrupt 70 */
- invint(preg); /* Invoke the interrupt */
-
- return(0);
-
- }